Skip to content

gfx12xx (RDNA4) regex update#5429

Open
wiersema1 wants to merge 3 commits intoAMReX-Codes:developmentfrom
wiersema1:RDNA4_regex
Open

gfx12xx (RDNA4) regex update#5429
wiersema1 wants to merge 3 commits intoAMReX-Codes:developmentfrom
wiersema1:RDNA4_regex

Conversation

@wiersema1
Copy link
Copy Markdown

Summary

Updated regex in Tools/Cmake/AMReXSetDefines.cmake to catch gfx12xx devices and use the correct wavefront size.

Additional background

My build environment includes

  • ROCm 6.2.4 / HIP 6.2.41134 / AMD Clang 18.0.0
  • GCC 13.3.0 (Ubuntu 24.04)
  • CMake 3.28.3

Checklist

The proposed changes:

  • fix a bug or incorrect behavior in AMReX
  • add new capabilities to AMReX
  • changes answers in the test suite to more than roundoff level
  • are likely to significantly affect the results of downstream AMReX users
  • include documentation in the code and/or rst files, if appropriate

Comment thread Tools/CMake/AMReXSetDefines.cmake Outdated
add_amrex_define( AMREX_USE_HIP NO_LEGACY )
add_amrex_define( NDEBUG ) # This address a bug that causes slow build times
if (${AMReX_AMD_ARCH} MATCHES "gfx1[01].*")
if (${AMReX_AMD_ARCH} MATCHES "gfx1[012].*")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (${AMReX_AMD_ARCH} MATCHES "gfx1[012].*")
if (${AMReX_AMD_ARCH} MATCHES "gfx1???")

Could you tell me if this works?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"gfx1???" gives an error during compilation.

CMake Error at Submodules/AMReX/Tools/CMake/AMReXSetDefines.cmake:68 (if):
if given arguments:

"gfx1201" "MATCHES" "gfx1???"

Regular expression "gfx1???" cannot compile
Call Stack (most recent call first):
Submodules/AMReX/Src/CMakeLists.txt:45 (include)

Copy link
Copy Markdown
Member

@AlexanderSinn AlexanderSinn May 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you try

if (${AMReX_AMD_ARCH} MATCHES "^gfx1..[a-z0-9]($|:)")

this should also cover the case of extra options like gfx90a:sramecc+:xnack+

https://godbolt.org/z/baGYGaG8o

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't know CMake's regex does not support ?.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does, but it is a modifier for the previous character (can match 0 or 1) and there can only be one question mark in a row.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got confused with shell.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AlexanderSinn your suggestion worked on my system and I've pushed that change into this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants